package mysql

import (
	"ezgin-example/i18n"

	"github.com/loebfly/ezgin"
)

type templateDao struct{}

func (receiver templateDao) Insert(value interface{}) error {
	db, err := ezgin.DBLite.Mysql()
	if err != nil {
		return i18n.DbConnectErr.Error()
	}
	err = db.Create(value).Error
	if err != nil {
		return i18n.DbInsertErr.ErrorWithMsg(err.Error())
	}
	return nil
}
